package com.my.chapter12;

public class practice5 {
    public static void main(String[] args) {
        int[] a = {1,2,3,4,5,6};
        int index = 8;
        boolean flag = true;
        while(flag){
            try {
                flag = false;
                System.out.println(a[index]);
            }catch (ArrayIndexOutOfBoundsException e){
                System.out.println("ArrayIndexOutOfBoundsException index= "+index);
                flag = true;
                index--;
            }
        }
    }
}
